package org.example.test;

import com.poizon.infrastructure.idem.core.annoations.AntiReSubmit;
import com.poizon.infrastructure.idem.core.annoations.Idempotent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/test")
public class TestController {
    @Idempotent(value = "{#TEST}")
    @GetMapping("test")
    public String test(
            @RequestParam String TEST
    ) {
        return TEST;
    }

    @AntiReSubmit(value = "{#TEST}")
    @GetMapping("test1111")
    public String test1(
            @RequestParam String TEST
    ) {
        return TEST;
    }
}
